<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="5" />
<title>Untitled Document</title>
</head>

<body>
<form method="get" action="ex4-1.php">
	<table>
    	<tr>
        	<td>
            Keyword son khiem:
            </td>
            <td>
            <input type="text" name="keyword" />
            </td>
        </tr>
        <tr>
        	<td>
            City:
            </td>
            <td>
            <select name="city">
            <option value="HCM">Ho Chi Minh</option>
            <option value="HN">Ha Noi</option>
            <option value="HUE">Hue</option>
            </select>
            </td>
        </tr>
        <tr>
            <td>
              Gender:  
            </td>
            <td>
             <input type="radio" name="gender" value="Male" checked="checked" />Male
            <input type="radio" name="gender" value="Female" />Female
            </td>
        </tr>
        <tr>
        	<td>&nbsp;</td>
            <td><input type="submit" value="Search" /></td>
        </tr>
    </table>
    <table>
    	<tr><td><a href="ex5.php?category=book">Book</a></td></tr>
        <tr><td><a href="ex5.php?category=sofware">Sofware</a></td></tr>
        <tr><td><a href="ex5.php?category=computer">Computer</a></td></tr>
        <tr><td><a href="ex5.php?category=electronic">Electronic</a></td></tr>
    </table>
    
</form>

<?php
	$so1=$_POST['so1'];
	$so2=$_POST['so2'];
	$pheptinh=$_POST['pheptinh'];
	if($pheptinh ==phepnhan)
	{
	$ketqua=$so1*$so2;
	}
	if($pheptinh==phepchia)
	{
	$ketqua=(doubleval($so1/$so2));	
	}
?>
<form method="post" action="ex4.php">
<table><tr><td><input type="radio" name="pheptinh" value="phepnhan" />Phep Nhan <input type="radio" name="pheptinh" value="phepchia" />Phep chia</td></tr></table>
<input type="text" name="so1" required="required" value="<?php echo $so1;?>"  /> 
<?php if($pheptinh=='phepnhan')
{
	echo '*';
}
if($pheptinh=='phepchia')
{
	echo ':';
}
?> <input type="text" name="so2" value="<?php echo $so2; ?>" required="required" />=<input type="text" name="ketqua" value="<?php echo $ketqua; ?>" /><input type="submit" value="Submit" /><input type="reset" value="Reset" />
	
</form>
</body>
</html>